home *** CD-ROM | disk | FTP | other *** search
- first=${no-yes}
- if test $first = yes
- then
- prog=`echo $0 | grep "^/"` ; export prog
- test $prog || prog="`pwd`/$0" ;export prog
- source=`echo $1 | grep "^/"` ;export source
- test $source || source="`pwd`/$1" ;export source
- dest=`echo $2 | grep "^/"` ; export dest
- test $dest || dest="`pwd`/$2" ;export dest
-
- no=no ; export no
- fi
- test -d $dest || mkdir $dest
- cd $source
- pwd
- for i in *
- do
- if (test -f "$i")
- then
- cp $i $dest
- fi
- done
- for x in *
- do
- if (test -d "$x")
- then
- (dest="${dest}/$x";export dest;source="${source}/$x";export source;$prog)
- fi
- done
- if (false)
- then
- #******************************* DOCZ Header ********************************
- .MODULE cp_r
- .LIBRARY util
- .TYPE command file
- .APPLICATION file
- .SYSTEM unix
- .AUTHOR Roger Wood
- .LANGUAGE Bourne Shell
- .DESCRIPTION
- Recursive copy of directories and sub directories.
- .ARGUMENTS
- cp_r <source_dir> <target_dir>
- .NARRATIVE
- The shell cp_r will take the contents of one directory (including sub-
- directories) and copy them to a target directory. The target directory
- need not exist before hand.
- .RETURNS
- nothing
- .ENDOC END DOCUMENTATION
- #****************************************************************************
- fi
-
-